home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 14414 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  837 b 

  1. Path: ix.netcom.com!netnews
  2. From: jdmorris@ix.netcom.com (Jason D. Morris)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: strstream destruction
  5. Date: Sat, 30 Mar 1996 03:34:39 GMT
  6. Organization: Netcom
  7. Message-ID: <315cab85.3232077@nntp.ix.netcom.com>
  8. References: <315AD92C.726D@itd.ssb.com>
  9. NNTP-Posting-Host: pon-mi2-25.ix.netcom.com
  10. X-NETCOM-Date: Fri Mar 29  7:33:46 PM PST 1996
  11. X-Newsreader: Forte Agent .99d/32.182
  12.  
  13. >    i plan to use ostrstream to create some strings , i would
  14. >like to pass the string created as a char * by calling ostrstream.str(). 
  15. >how do i free the memory allocated can i just call delete on the char *
  16. >returned by ostrstream.str().
  17.  
  18. Calling the ostrstream::str() freezes the dynamic buffer.  To unfreeze
  19. the buffer, call ostrstream::freeze( 0 ).  The stream will take care
  20. of deallocating the buffer for you.
  21.  
  22. Jason
  23.  
  24.